 
  <? if ($edit!="t"&&strlen($this_folder->pimp_parentfolder)>0) { 
  
	 $icon    = $folder_icons[$this_folder->pimp_foldertype]; 
	 $caption = $folder_captions[$this_folder->pimp_foldertype]; 
	 $bgcolor = $folder_border_colors[$this_folder->pimp_foldertype];
	 
	 if (strlen($this_folder->pimp_parentfolder)>0) $dircount -= 1; ?> 
        <table id=filecontrol width="180" 
		bgcolor="<?=  $bgcolor ?>" 
		cellpadding="6" cellspacing="1">
        <tr>
           <td>
		    <img src="<?= $href ?>?i=o" id="imfilecontrol" align="absmiddle">
            <a style="color:white" href="javascript:rollup('filecontrol')"><?= $caption ?> Folder details</a>
           </td>
        </tr>
		
		
        <tr>
           <td bgcolor=white>
           <table>
              <tr>
                <td></td>
                <td>
                <div style="width:150;overflow:hidden">
				<img src="<?= $href ?>?i=<?= $icon ?>" align="absmiddle">
				<b><?= $this_folder->pimp_foldername ?></b></div>
                 
				
				<? if ($this_folder->pimp_foldertype==FOLDER_TYPE_REMOTE_SUBFOLDER) {  ?>
				    <a href="javascript:fb_edit('d','<?= $dirname ?>', 'rd', '<?= $this_folder->pimp_parentfolder ?>', 'f','','s','')" style="color:teal"><u>Up to Parent Folder</u></a><br>
			     <? } else if ($this_folder->pimp_foldertype==FOLDER_TYPE_REMOTE_ROOT) { ?>
                    <a href="javascript:gofolder('<?= $this_folder->pimp_parentfolder ?>')" style="color:firebrick"><u>Up to Parent Folder</u></a><br>				 
				<?  } else if (strlen($this_folder->pimp_parentfolder)>0) { ?>
                    <a href="javascript:gofolder('<?= $this_folder->pimp_parentfolder ?>')" style="color:blue"><u>Up to Parent Folder</u></a><br>
				<? } ?>
				
				
				<? if ($this_folder->pimp_foldercount>0) { ?>
                Folders: <?= $this_folder->pimp_foldercount ?><br>
				<? } ?>
				 
			   
                Files: <?= $this_folder->pimp_filecount ?><br>
                Date Last Modified: <?= date("F d Y H:i:s", filemtime ("$dirname")); ?>
						
				<font color=gray size=1>
				<?= $is_virtual?"<br><br><b>Virtual folders</b> load files from other computers or servers. Files may load slowly the first time.":"" ?>
				<?= $is_media?"<br><br><b>Media folders</b> load files from other computers or servers. Files may load slowly.":"" ?>
				</font>		 
					
				<? if ($is_admin) {
				    permtable ($dirname, "folder");
				} else { ?> 
				 <br><br>
				 View as:<br>
				 <?  
					 if ($is_thumbnails) { ?>
						 &nbsp;&nbsp;<a href="javascript:fb_edit('v', 'd', 'r', 'on')" style="color:blue"><u>Details</u></a><br>
						 &nbsp;&nbsp;<a href="javascript:fb_edit('v', '')" style="color:blue"><u>Film strip</u></a><br>
						 &nbsp;&nbsp;<b>Thumbnails</b>
					 <? } else if ($is_details) { ?>
						 &nbsp;&nbsp;<b>Details</b> <br>
						 &nbsp;&nbsp;<a href="javascript:fb_edit('v', '')" style="color:blue"><u>Film strip</u></a><br>
						 &nbsp;&nbsp;<a href="javascript:fb_edit('v', 't', 'r', 'on', 'w', MM_findObj('Dx').offsetWidth)" style="color:blue"><u>Thumbnails</u></a> 
					 <? } else { ?>
						 &nbsp;&nbsp;<a href="javascript:fb_edit('v', 'd', 'r', 'on')" style="color:blue"><u>Details</u></a><br>
						 &nbsp;&nbsp;<b>Film strip</b> <br>
						 &nbsp;&nbsp;<a href="javascript:fb_edit('v', 't', 'r', 'on', 'w', MM_findObj('Dx').offsetWidth)" style="color:blue"><u>Thumbnails</u></a>
					 <? } ?>  
				<? } ?>
		  
		 <br> <br> 
		 <? if ($is_admin) { ?>
		 <img src="<?= $href ?>?i=n" align="absmiddle">
		 <a href="javascript:fb_edit('j', '', 'qm', '')" style="color:blue"><u>Exit admin mode</u></a>
		 <? } else if ($this_folder->pimp_secure) { ?>
		 <img src="<?= $href ?>?i=n" align="absmiddle">
		 <a href="javascript:fb_edit('j', 'm')" style="color:gray"><u>Customize folder</u></a>
		 <? } ?>
		  
                </td>
              </tr>
              
           </table>
         
           </td>
        </tr>
       
        </table>

         <br><br>
         

<? } ?>
<?   if (strlen($filename)>0&&$filename!="/") { 
    if (!$is_admin&&iseditable ($filename)) { ?>
	 
        <table width="180" bgcolor="steelblue" cellpadding="6" cellspacing="1" id="imagecontrol">
        <tr>
           <td>
		    <img src="<?= $href ?>?i=o" id="imimagecontrol" align="absmiddle">
            <a style="color:white" href="javascript:rollup('imagecontrol')"><?= my_content_type($filename)=="txt"?"Text file":"Picture"?> tasks</a> 
           </td>
        </tr>
       
        <tr>
           <td bgcolor=white>
           <table>
		   
		   
		   <? if (my_content_type($filename)=="txt") { ?>
		   
              <tr>
                <td><img src="<?= $href ?>?i=pm" align=absmiddle></td>
				<? if ($edit=="t") { ?>
				<td><a href="javascript:fb_edit('e', 'b', 'mfile', '')">Exit edit mode</a></td>
				<? } else { ?>
                <td><a href="javascript:fb_edit('e', 't', 'r', 'on')">Edit this file</a></td>
				<? } ?>
              </tr>
		   
		   <? } else if (my_content_type($filename)=="") { ?>
		   
		   
		   <? } else if (my_content_type($filename)=="jpg"||my_content_type($filename)=="gif"||my_content_type($filename)=="png") { ?>
			   <? if ($pv=="") { ?>
				  <tr>
					<td><img src="<?= $href ?>?i=pe" align=absmiddle></td>
					<td><a href="javascript:fb_edit('r','<?= $off ?>')"><?= $message ?></a></td>
				  </tr>
			   <? } ?>
              <tr>
                <td><img src="<?= $href ?>?i=pf" align=absmiddle></td>   
				<? if ($view!="s") { ?>          
				<td><a href="javascript:fb_edit('v','s','pv','on','r','on')">Display as slide show</a></td>
                <? } else { ?>
				<td><a href="javascript:fb_edit('v','')">Close slide show</a></td>
				<? } ?>
              </tr> 
              <tr>
                <td><img src="<?= $href ?>?i=d" align=absmiddle></td>
                <td><a href="thumbnail.php?i=<?= $filename ?>&h=X&ft=<?= my_content_type($filename) ?>&ff=<?= filetitle($filename) ?>" target="_blank">Save this image</a></td>
              </tr>
              <tr>
                <td><img src="<?= $href ?>?i=g" align=absmiddle></td>
                <td><a href="javascript:fb_edit('e', '', 'v', '')">Open Editor</a></td>
              </tr>
             <!-- <tr>
                <td align="center">T</td>
                <td><a target="_blank" href="table.php?d=<?= $filename ?>">Open Image as Text</a></td>
              </tr> -->
              <tr>
                <td><img src="<?= $href ?>?i=pm" align=absmiddle></td>
				<? if ($edit=="e") { ?>
				<td><a href="javascript:fb_edit('e', '')">Exit edit mode</a></td>
				<? } else { ?>
                <td><a href="javascript:fb_edit('e', 'e', 'r', 'on', 'v', '')">Edit this image</a></td>
				<? } ?>
              </tr>
		   <? } ?>
           </table>
         
           </td>
        </tr>
       
        </table>
         
         
         <br><br>
         <? } ?>
 
 <?
 $file_count  = 0;
 $file_roster = file_to_array($editconfig); 
 if (count($file_roster)>1) 
 { ?>
        <table   width=180 bgcolor="steelblue" cellpadding=6 cellspacing=1 id="myopenfiles">
        <tr>
           <td>
		    <img src="<?= $href ?>?i=o" id="immyopenfiles" align="absmiddle">
            <a style="color:white" href="javascript:rollup('myopenfiles');scroll_display()">Open Files</a>  
           </td>
        </tr>
       
        <tr style="display:none">
           <td bgcolor=white>
   <?  
     print "<table>";
	 while (list($key,$val)=each( $file_roster ))
	 {
		if ($file_count>0)
		{
		    $text="";
			$file="";
			parse_str($val); 
			$editor  = $text==""?"e":"t";
			$icon    = $text==""?"pu":"l";
			$flag    = $text==""?"efile":"mfile";
			$label   = $text==""?$file:$text;
			print "<td width=40 align=center bgcolor=whitesmoke><div class=preload>".$label."</div></td>";
			//print "<img align=absmiddle src='$href?i=$icon'>";
			//print "<a href=\"javascript:fb_edit('e', '".$editor."', '".$flag."', '".$label."', 'f', '', 'v', '')\">".filetitle($label,20)."</a>";
			//print "<br>";
		}
		$file_count ++;
		if (($file_count-1)%4==0)
		{
		    print "</tr><tr>";
		}
	 }
     print "</table>";
	 print "<div align=right></div>";?>
	 
           </td>
        </tr> 
       
        </table>
       <br><br>
   <?
 }
 ?>
		 
        <table width=180 bgcolor="gray" cellpadding=6 cellspacing=1 id="filedetails">
        <tr>
           <td>
		    <img src="<?= $href ?>?i=o" id="imfiledetails" align="absmiddle">
            <a style="color:white" href="javascript:rollup('filedetails')">File details</a>  
           </td>
        </tr>
       
        <tr>
           <td bgcolor=white>
           <table>
              <tr>
                <td></td>
                <td>
				<? if ($is_admin) { ?>
		<form action="<?= $href ?>?<?= $qs?>" method="post">
					<b>General</b>
					<div  style="border:solid 1px silver;width:155px;padding:2px;background-color:#e0e0FF">
					<b>Name </b><br>
					<input type="text" style="font-weight:bold" name="newfilename" value="<?= filetitle($filename) ?>"> 
					<input type="hidden" style="font-weight:bold" name="oldfilename" value="<?= $fullpath ?>">
					<div align="right"><input type="submit" value="Save"></div> </div>
					</form>
				<? } else { ?>
					<div style="width:150;overflow:hidden"><b><?= filetitle($filename) ?></b></div>
					
					Size: <?= $fs ?><br>
					Type: <?= $ft ?><br>
					Date Last Modified: <?= $fd ?>
					
                <? } ?>
				
				<? if ($is_admin) {
				    permtable ($path.$filename, "file");
				} else if (my_content_type($filename)=="txt") {
				
				} else if (my_content_type($filename)=="") {
				 
				} else { ?> 
					<br><br>
					<center>
					<img src="thumbnail.php?i=<?= $filename ?>&w=140" id="detailpic">
					</center> 
				<? } ?>
                </td>
              </tr>
              
           </table>
           
           </td>
        </tr> 
       
        </table>
		<div align="left">
		<? }
		print "<!--<xmp>";
		print_r($_GET);
		print "</xmp>";
		?></div>-->